import request from '@/utils/request'

export default {
  // 列表
  query(data) {
    return request({
      url: `/v1/finance/billing/list`,
      method: 'post',
      data
    })
  },
  // 上传回执
  upload(data) {
    return request({
      url: `/v1/finance/billing/upload`,
      method: 'post',
      data
    })
  },
  // 录入发票
  save(data) {
    return request({
      url: `/v1/finance/billing/enter-invoice`,
      method: 'post',
      data
    })
  },
  // 导入发票信息
  importInvoice(data) {
    return request({
      url: `/v1/finance/billing/import-invoice`,
      method: 'post',
      data
    })
  },
  // 根据开票生成合同
  addByBill(data) {
    return request({
      url: `/v1/contract/contract/add-by-bill`,
      method: 'post',
      data
    })
  },
  // 作废
  cancel(data) {
    return request({
      url: `/v1/finance/billing/batch-cancel`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 导入发票信息文件
  importFile(data) {
    return request({
      url: `/v1/finance/billing/import-invoice-file`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 批量打印
  print(data) {
    return request({
      url: `/v1/finance/billing/batch-print`,
      method: 'post',
      data,
      returnData: true
    })
  },
  // 详情
  detail(params) {
    return request({
      url: `/v1/finance/billing/detail`,
      method: 'get',
      params
    })
  },
  //生成开票清单
  addByBillingList(data) {
    return request({
      url: `/v1/contract/contract/add-by-billing-list`,
      method: 'post',
      data
    })
  },
  //生成送货清单
  addByBillingDelivert(data) {
    return request({
      url: `/v1/contract/contract/add-by-billing-deliver`,
      method: 'post',
      data
    })
  },
  //生成开票明细
  addByBillingListDetail(data) {
    return request({
      url: `/v1/contract/contract/add-by-billing-list-detail`,
      method: 'post',
      data
    })
  },
}
